//
//  NewChangeSecondYZViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/30.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewChangeSecondYZViewController.h"
#import "JTCSM.h"
#import "MyInfoView.h"
static CGFloat myinfoHeight = 50;
@interface NewChangeSecondYZViewController ()<UITextFieldDelegate>
{
    NSArray *imageNameArray;
    NSArray *placeholderArray;
    UIView *backView;
    
}

@end

@implementation NewChangeSecondYZViewController

- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.hidden = NO;
    [self.view setBackgroundColor:RGBACOLOR(241, 241, 241, 1)];
    [df isRemoveTarbar:YES];
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotBack)];
    [self layoutView];
}

- (void)layoutView{
    
    MyInfoView *view2 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KagainChangeHeight, KCONTROLLERWith, myinfoHeight) imagename:@"绑定银行卡icon.png" title:@"请输入持卡人本人的银行卡信息" placeholder:nil isShowLabel:labelType radioBtnIndex:0 GroupId:@""];
    view2.label.frame = CGRectMake(view2.label.LC_x, view2.label.LC_y, KCONTROLLERWith, view2.label.LC_height);
    [self.view addSubview:view2];
    view2.backgroundColor = RGBACOLOR(241, 241, 241, 1);
    
    backView = [[UIView alloc]initWithFrame:CGRectMake(0, myinfoHeight+KagainChangeHeight, self.view.frame.size.width,myinfoHeight*5)];
    backView.userInteractionEnabled = YES;
    backView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:backView];
    imageNameArray =@[@"卡号",@"持卡人姓名",@"证件类型",@"证件号码",@"手机号码"];
    NSString *bankcard = [_model.bank_card stringByReplacingCharactersInRange:NSMakeRange(0, _model.bank_card.length-4) withString:@""];
    placeholderArray=@[[NSString stringWithFormat:@"%@（%@）",_model.bank_name, bankcard],@"请输入完整姓名",@"",@"请输入证件号码",@"请输入银行预留手机号码"];
    for (int i = 0; i < placeholderArray.count; i++) {
        MyInfoView *view1 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:nil title:imageNameArray[i] placeholder:placeholderArray[i] isShowLabel:RightlabelType radioBtnIndex:0 GroupId:@""];
        if (i == 0 ) {
            view1.textfield.enabled = NO;
            view1.textfield.frame = CGRectMake(view1.textfield.LC_x, view1.textfield.LC_y, KCONTROLLERWith-120, view1.textfield.LC_height);
        }
        if (i == 2) {
            view1.textfield.enabled = NO;
            view1.textfield.text = @"身份证";
        }
        view1.tag = 100+i;
        view1.userInteractionEnabled = YES;
        [backView addSubview:view1];
    }
    
    
    UIButton *tijiaobutton = [UIButton buttonWithType:UIButtonTypeCustom];
    tijiaobutton.frame = CGRectMake(25, KVIEW_Y(backView)+20, KCONTROLLERWith-40, 50);
    [tijiaobutton addTarget:self action:@selector(tijiao) forControlEvents:UIControlEventTouchUpInside];
    [df layerWithView:tijiaobutton radius:25 width:0 color:nil];
    tijiaobutton.backgroundColor = KZhuTiRGB;
    [tijiaobutton setTitleColor:RGBACOLOR(51, 51, 51, 1) forState:UIControlStateNormal];
    [tijiaobutton setTitle:@"确定" forState:UIControlStateNormal];
    [self.view addSubview:tijiaobutton];
    
}


#pragma mark uitextfieldDelegate
- (void)valueChanged:(UITextField *)textfield{
    
}
- (void)saveloginInfo:(UIButton *)sender{
    
}
- (void)tijiao{
    [self gotoNewShangChuanBankImageViewController];
}

- (void)gotoNewShangChuanBankImageViewController{
   
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
